package com.xpec.cipher.tals.record;

import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;

import com.xpec.cipher.tals.TalsConstance;

public class ChangeKeyRecord extends TalsRecord
{
	private byte[] verifyData = null;
	byte type = TalsConstance.CONTENT_TYPE_HAND_SHAKE;
	
	public ChangeKeyRecord(byte[] verifyData)
	{
		this.verifyData = verifyData;
	}
	
	public ChangeKeyRecord(byte[] verifyData , byte type)
	{
		this.verifyData = verifyData;
		this.type = type;
	}
	
	@Override
	protected int getContentLength()
	{
		return verifyData.length;
	}

	@Override
	protected byte getContentType()
	{
		return type;
	}

	@Override
	protected ChannelBuffer resolveSubStruct()
	{
		return ChannelBuffers.wrappedBuffer(verifyData , 0 , verifyData.length);
	}

}
